﻿Imports System.Diagnostics
Imports PhDir.Repository.User

Namespace Repository
    Public Class UserRepository

        Friend Sub New()
            Me.InsertUser = New InsertUser()
            Me.UpdateUser = New UpdateUser()
            Me.DeleteUser = New DeleteUser()
        End Sub

        Private Property InsertUser As IInsert(Of Model.Phone)
        Private Property UpdateUser As IUpdate(Of Model.User)
        Private Property DeleteUser As IDelete(Of Model.User)

        Public Function Insert(ByVal phone As Model.Phone) As Boolean
            Return Me.InsertUser.Insert(phone)
        End Function

        Public Function Update(ByVal oldUser As Model.User, ByVal newUser As Model.User) As Boolean
            Return Me.UpdateUser.Update(oldUser, newUser)
        End Function

        Public Function Delete(ByVal user As Model.User) As Boolean
            Return Me.DeleteUser.Delete(user)
        End Function
    End Class
End Namespace
